/*

*/
#include <cstdio>
#include <cstring>
#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
const int maxn = 2e5+10;
long long suma[maxn];
long long sumb[maxn];
long long a[maxn];
int main()
{
	int t;
	int cnt = 0;
	scanf("%d",&t);
	while(t--)
	{
	//	printf("************%d\n",++cnt);
		int n;
		scanf("%d",&n);
		suma[0] = 0;
		suma[1] = 0;
		int flaga = 0;
		int flagb = 0;
		long long ans = 0;
		long long minna = 1e18;
		long long maxxa = -1e18;
		long long minnb = 1e18;
		long long maxxb = -1e18;
		scanf("%d",&a[1]);
		ans += a[1];
		for(int i = 2;i<=n;i++)
		{
			scanf("%lld",&a[i]);
			if(i%2) 
			{
				suma[i] = suma[i-1];	
				ans += a[i];
			}
			else
			{
				suma[i] = suma[i-1] + (a[i]-a[i-1]);
			}
			if(suma[i]>=maxxa) 
			{
				maxxa = suma[i];
				flaga = i;
			}
		}
		sumb[0] = 0;
		sumb[1] = 0;
		sumb[2] = 0;
		for(int i = 3;i<=n;i++)
		{
			if(i%2)
			{
				sumb[i] = sumb[i-1] + (a[i-1]-a[i]);
			}
			else sumb[i] = sumb[i-1];
			if(sumb[i]>=maxxb)
			{
				maxxb = sumb[i];
				flagb = i;
			}
		}
		for(int i = flaga;i>=1;i--)
		{
			if(minna>=suma[i])
			{
				minna = suma[i];
			}
		}
	//	printf("****%lld %lld\n",maxxa,minna);
		for(int i = flagb;i>=1;i--)
		{
			if(minnb>=sumb[i])
			{
				minnb = sumb[i];
			}
		}
	//	printf("****%lld %lld\n",maxxb,minnb);
		if(n==1) printf("%lld\n",ans);
		else printf("%lld\n",ans+max(maxxb-minnb,maxxa-minna));
	}
}
